Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@jsii/spec
Advanced tools
@jsii/spec is a package that provides TypeScript interfaces and JSON schema definitions for the jsii specification. It is used to define and validate the structure of jsii assemblies, which are used to enable interoperability between different programming languages.
TypeScript Interfaces
This feature allows you to define and work with jsii assemblies using TypeScript interfaces. The code sample demonstrates how to create a basic jsii assembly object.
import { Assembly } from '@jsii/spec';
const assembly: Assembly = {
schema: 'jsii/0.10.0',
name: 'my-package',
version: '1.0.0',
description: 'A sample jsii package',
license: 'Apache-2.0',
dependencies: {},
bundled: [],
types: {},
targets: {}
};
console.log(assembly);
JSON Schema Definitions
This feature provides JSON schema definitions for jsii assemblies, allowing you to validate the structure of your jsii assembly objects. The code sample demonstrates how to use the Ajv library to validate a jsii assembly object against the schema.
const schema = require('@jsii/spec/schema.jsii.json');
const validate = (data) => {
const Ajv = require('ajv');
const ajv = new Ajv();
const validate = ajv.compile(schema);
const valid = validate(data);
if (!valid) console.log(validate.errors);
return valid;
};
const data = {
schema: 'jsii/0.10.0',
name: 'my-package',
version: '1.0.0',
description: 'A sample jsii package',
license: 'Apache-2.0',
dependencies: {},
bundled: [],
types: {},
targets: {}
};
console.log(validate(data));
typescript-json-schema is a package that generates JSON schema from your TypeScript types. It is similar to @jsii/spec in that it deals with JSON schema and TypeScript, but it focuses on generating schema from TypeScript code rather than defining and validating jsii assemblies.
Ajv is a JSON schema validator that can be used to validate JSON data against a schema. While @jsii/spec provides specific schema definitions for jsii assemblies, Ajv is a more general-purpose tool for JSON schema validation.
json-schema is a package that provides a collection of JSON schema validation tools. It is similar to @jsii/spec in that it deals with JSON schema validation, but it is a more general-purpose library not specifically tailored to jsii assemblies.
Defines the JSON specification for .jsii metadata files, part of the jsii project.
jsii is distributed under the Apache License, Version 2.0.
FAQs
Specification for jsii assemblies
We found that @jsii/spec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.